The result from the nmf
method is a
object that
holds either all or only the best run, depending on the running options:
# keep only the best run}
object <- nmf(X, r, nrun=20)
# keep all the runs}
object <- nmf(X, r, nrun=20, .options='k')
The methods documented here are used to handle such results. They are usually independent of the type of result and can be used without change in either situation (all runs kept or only the best one).
Note that when only the best result is kept, the result object conveniently inherits from
all the methods available for single runs. Therefore it can be handled as if it had been
computed by a single NMF run and all the methods defined for such results can be used
(cf.
and NMF-utils
).
See
and
for details on the classes
that implement respectively the case where all the runs are kept and only the best run is kept.
cophcor(object, ...)
dispersion(object, ...)
## S3 method for class 'NMFfitX': fit(object)
nrun(object, ...)
## S3 method for class 'NMFfitX': metaHeatmap(object, ...)
## S3 method for class 'NMFfitXn': predict(object, ...)
## S3 method for class 'NMFfitX': runtime.all(object)
## S3 method for class 'NMFfitXn': runtime.all(object, null=FALSE, warning=TRUE)
seqtime(object, ...)
## S3 method for class 'NMFfitX': summary(object, ...)
runtime.all
for NMFfitXn
objects to specify if
the result should be NULL
when the object has no time data is stored the total
computation time. In this case, if null=FALSE
(default), the method returns the
sequential time (cf. seqtime
below) instead of NULL
. It also emits a warning
which can be toggle with argument warning
.
}
matrix
or an object that inherits from class
or
-- depending on the method. }
runtime.all
for NMFfitXn
objects to specify
if a warning should be emitted when the object has no time data the total computation time
and the sequential time is returned instead of NULL
(cf. argument null
).
}
}metaHeatmap
: graphical parameters passed to functionheatmap.2
predict
: extra arguments passed to functionpredict,NMF-method
summary
: extra arguments liketarget
orclass
passed to
the methodsummary,NMFfit-method
.
Sparse non-negative matrix factorizations via alternating non-negativity-constrained least squares for microarray data analysis
Kim, H. & Park, H. (2007)
Bioinformatics.
[object Object]
# build the class factor groups <- as.factor(do.call('c', lapply(seq(3), function(x) rep(x, counts[x]))))
# perform multiple runs of NMF (keep best only) res <- nmf(V, 3, nrun=5) res
# compute summary measures summary(res)
# compute more summary measures summary(res, target=V, class=groups)
# plot a heatmap of the consensus matrix with extra annotations metaHeatmap(res, class=groups)
# retrieve the predicted clusters of samples predict(res)
# perform multiple runs of NMF and keep all the runs res <- nmf(V, 3, nrun=5, .options='k') res
# extract best fit fit(res)
# compute/show computational times runtime.all(res) seqtime(res)